package cn.edu.scau.cmi.guihao.allModels;

import java.io.IOException;

import cn.edu.scau.cmi.guihao.pane.AbstractFactoryPnae;
import cn.edu.scau.cmi.guihao.pane.ClassAdapterPane;
import cn.edu.scau.cmi.guihao.pane.FactoryPane;
import cn.edu.scau.cmi.guihao.pane.FitComponentPane;
import cn.edu.scau.cmi.guihao.pane.HibernatePane;
import cn.edu.scau.cmi.guihao.pane.InterfaceProgrammingPane;
import cn.edu.scau.cmi.guihao.pane.ObjectAdapterPane;
import cn.edu.scau.cmi.guihao.pane.SafetyComponentPane;
import cn.edu.scau.cmi.guihao.pane.SimpleFactoryPane;
import cn.edu.scau.cmi.guihao.pane.SingleMultiplePane;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.TabPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

public class AllModelsController {

	@FXML
	private ImageView photoView; 
	
	public void init() {
		Image image = new Image("cn/edu/scau/cmi/guihao/img/timg.jpg");
		photoView.setImage(image);
	}
	
	public void InterfaceModel() {
		Scene scene = new Scene(new InterfaceProgrammingPane());
		Stage stg=new Stage();
		stg.setTitle("接口模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void singleMultipleModel() {
		Scene scene = new Scene(new SingleMultiplePane(),400,400);
		Stage stg=new Stage();
		stg.setTitle("单例多例模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void abstractFactoryModel() throws IOException {
		Pane pane = new AbstractFactoryPnae();
		Scene scene = new Scene(pane); 
		Stage stg=new Stage();
		stg.setTitle("抽象工厂模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void classAdapter() {
		Scene scene = new Scene(new ClassAdapterPane(),400,350);
		Stage stg=new Stage();
		stg.setTitle("类适配器模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void factory() {
		Scene scene = new Scene(new FactoryPane(),600,400);
		Stage stg=new Stage();
		stg.setTitle("工厂模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void fitComponent() {
		Scene scene = new Scene(new FitComponentPane(),600,400);
		Stage stg=new Stage();
		stg.setTitle("一致性组合模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void hibernate() {
		Scene scene = new Scene(new HibernatePane(),600,400);
		Stage stg=new Stage();
		stg.setTitle("hibernate框架");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void objectAdapter() {
		Scene scene = new Scene(new ObjectAdapterPane(),400,350);
		Stage stg=new Stage();
		stg.setTitle("对象适配器模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	
	public void simpleFactory() {
		Scene scene = new Scene(new SimpleFactoryPane(),600,400);
		Stage stg=new Stage();
		stg.setTitle("简单工厂模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	public void safetyComponent() {
		Scene scene = new Scene(new SafetyComponentPane(),600,400);
		Stage stg=new Stage();
		stg.setTitle("安全性组合模式");
		stg.setScene(scene); 
		stg.show();
	}
	
	
}
